package com.liww.resource;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;

import org.apache.xpath.operations.String;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.liww.service.DeveloperService;

@Component
@Path("/developer")
public class DeveloperResource extends AbstractCRUDResource{
	@Context	
	HttpServletRequest request;
	@Context
	HttpServletResponse response;
	
	@Autowired
	private DeveloperService developerService;
		
	@GET
	@Path("queryMapData")
	@Produces(MediaType.APPLICATION_JSON)
	public Response resultMapJson(){	
		Object resultTop10City = null;
		Object resultCapitalCity = null;
		Map map = new HashMap();
		Status http_code = Response.Status.OK;
		resultTop10City = developerService.queryMapTopCity();//炫光前十位热门城市数据(非省会)适用于一级地图
		resultCapitalCity = developerService.queryMapCapitalCity();//中国地图省会城市数据,适用于一级地图
		map.put("Top10City", resultTop10City);
		map.put("CapitalCity", resultCapitalCity);
		return Response.status(http_code).entity(map).build();
	}
}
